EXTEND #1: Now try customizing your program! Be sure to meet these minimum technical requirements:

The perimeter of a rectangle is calculated with 2 times the height plus 2 times the width (perimeter = 2h + 2w).

  1. Create a new variable under rect_area and name it rect_perim. Set it equal to the rectangle's perimeter.
  2. Add a Variable Display above .mouse_move() to show rect_perim. Change the coordinates to 30,20.
  3. Click Run. At the moment, rect_perim only shows a constant value. Click Next and Submit.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)